function ThunderNoteObject(xml)
{
  this.assignRawXml(xml);
}


ThunderNoteObject.prototype.assignRawXml=function(xml)
{
  var parser = new DOMParser();
  var tmp;
  var tagDocs;
  var counter;
  var serializer=new XMLSerializer();
  
  this.rawXml=null;
  this.title=null;
  this.body=null;
  this.creationdtg=-1;
  this.updatedtg=-1;
  this.applicationnotes=null;
  this.category=null;
  this.searchterms=null;
  this.privatenote=true;

  if(xml!=null)
  {
    this.rawXml=xml;
    this.xmlDoc=parser.parseFromString(this.rawXml,"text/xml");

    if(this.xmlDoc.getElementsByTagName("Title")[0].childNodes[0]!=null)
      this.title=this.xmlDoc.getElementsByTagName("Title")[0].childNodes[0].nodeValue;
    if(this.xmlDoc.getElementsByTagName("Body")[0].childNodes[0]!=null)
      this.body=this.xmlDoc.getElementsByTagName("Body")[0].childNodes[0].nodeValue;
    
    if(this.xmlDoc.getElementsByTagName("CreationDTG")[0].childNodes[0]!=null)
      this.creationdtg=this.xmlDoc.getElementsByTagName("CreationDTG")[0].childNodes[0].nodeValue;
    
    if(this.xmlDoc.getElementsByTagName("UpdateDTG")[0].childNodes[0]!=null)
      this.updatedtg=this.xmlDoc.getElementsByTagName("UpdateDTG")[0].childNodes[0].nodeValue;
    
    if(this.xmlDoc.getElementsByTagName("ApplicationNotes")[0].childNodes[0]!=null)
      this.applicationnotes=this.xmlDoc.getElementsByTagName("ApplicationNotes")[0].childNodes[0].nodeValue;
    
    if(this.xmlDoc.getElementsByTagName("Category")[0].childNodes[0]!=null)
    this.category=this.xmlDoc.getElementsByTagName("Category")[0].childNodes[0].nodeValue;
    
    if(this.xmlDoc.getElementsByTagName("SearchTerms")[0].childNodes[0]!=null)
      this.searchterms=this.xmlDoc.getElementsByTagName("SearchTerms")[0].childNodes[0].nodeValue;

    if(this.xmlDoc.getElementsByTagName("Private")[0]!=null)
    {
      if(this.xmlDoc.getElementsByTagName("Private")[0].childNodes[0]!=null)
      {
        tmp=this.xmlDoc.getElementsByTagName("Private")[0].childNodes[0].nodeValue;
        this.privatenote=true;
        if(tmp!=null)
        {
          if(tmp!='')
          {
            if(tmp=='false')
              this.privatenote=false;
          }
        }
      }
    }
  }
  else
  {
    this.rawXml=null;
    this.title=null;
    this.body=null;
    this.creationdtg=-1;
    this.updatedtg=-1;
    this.applicationnotes=null;
    this.category=null;
    this.searchterms=null;
    this.privatenote=true;
  }
}
